package com.free.lazy.service.impl;

import com.free.lazy.entity.BaseLoginRequest;
import com.free.lazy.entity.LoginForm;
import com.free.lazy.factory.LoginFactory;
import com.free.lazy.service.SecurityService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class SecurityServiceImpl implements SecurityService {
    private final LoginFactory loginFactory;

    @Override
    public void login(LoginForm loginForm) {
        BaseLoginRequest request = new BaseLoginRequest();
        request.setUsername(loginForm.getUsername());
        request.setPassword(loginForm.getPassword());
        request.setSecurityToken(loginForm.getSecurityToken());
        loginFactory.login(request);
    }
}
